//
//  JKUserIconButton.swift
//  afanti
//
//  Created by albert on 16/4/15.
//  Copyright © 2016年 albert. All rights reserved.
//

import UIKit

class JKUserIconButton: UIButton {

    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.titleLabel?.textAlignment = NSTextAlignment.Center
        self.adjustsImageWhenHighlighted = false
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        imageView?.frame = CGRect(x: 0, y: 0, width: self.bounds.size.width, height: self.bounds.size.width)
        
        
        titleLabel?.frame = CGRect(x: 0, y: (imageView?.bounds.size.height)! + 10, width: self.bounds.size.width, height: self.bounds.size.height - (imageView?.bounds.size.height)! + 10)
    }
    

}
